FROM ubuntu:14.04

ADD build/sources.list /etc/apt/sources.list

RUN apt-get -y update
RUN apt-get -y upgrade
RUN apt-get install -y software-properties-common

RUN apt-get install -y --force-yes php5-cli php5-fpm php5-mysql php5-pgsql php5-sqlite php5-curl \
    php5-gd php5-mcrypt php5-intl php5-imap php5-tidy

RUN ln -s /etc/php5/mods-available/mcrypt.ini /etc/php5/fpm/conf.d/mcrypt.ini
RUN ln -s /etc/php5/mods-available/mcrypt.ini /etc/php5/cli/conf.d/mcrypt.ini

RUN apt-get install -y vim
RUN apt-get install -y git 

RUN mkdir /var/share
RUN chmod 777 /var/share

RUN apt-get install -y nginx 
#RUN mkdir -p /etc/nginx/sites-available
#RUN mkdir -p /etc/nginx/sites-enabled 
#RUN mkdir -p /etc/nginx/conf.d 
#RUN chmod 755 /etc/nginx/sites-available /etc/nginx/sites-enabled /etc/nginx/conf.d
#RUN touch /etc/nginx/sites-available/default
#RUN ln -s /etc/nginx/sites-available/default /etc/nginx/sites-enabled/default 
#RUN chmod 664 /etc/nginx/sites-available/default /etc/nginx/sites-enabled/default

ADD build/start.sh /sbin/start.sh
RUN chmod 755 /sbin/start.sh

EXPOSE 80
# End Nginx-PHP

RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
